// Problem: P3397 地毯
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P3397
// Memory Limit: 125 MB
// Time Limit: 1000 ms

#include <iostream>
#include <cstdio>
using namespace std;
const int N=1e3+5;
int a[N][N],b[N][N];
int n,m,xa,ya,xb,yb;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++){
		scanf("%d%d%d%d",&xa,&ya,&xb,&yb);
		b[xa][ya]++;
		b[xb+1][ya]--;
		b[xa][yb+1]--;
		b[xb+1][yb+1]++;
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			a[i][j]=a[i-1][j]+a[i][j-1]-a[i-1][j-1]+b[i][j];
			printf("%d ",a[i][j]);
		}
		printf("\n");
	}
	return 0;
}
